package  
{
	import interactive.turnAnimation.TurnPlayer;
	import UILib.LeftBtn;
	import UILib.RightBtn;
	
	/**
	 * ...
	 * @author Ning
	 */
	public class Player extends TurnPlayer 
	{
		public function Player(width:Number,
							 height:Number,
							 itemCount:int,
							 showCount:int,
							 rendererCls:Class,
							 showType:String='middle',
							 intervalK:Number = 1,
							 zoomK:Number = 1,
							 speed:Number = 1,
							 transition:String='easeOutCubic') 
		{
			
			super(width, height, itemCount, showCount, rendererCls, showType, intervalK, zoomK, speed, transition);
		
		}
		public function setData(data:Array):void
		{
			for (var i:int = 0; i < data.length; i++ )
			{
				var vo:PlayerVO = data[i] as PlayerVO;
				var item:ItemRenderer = this.items[i] as ItemRenderer;
				if (item)
				    item.setData(vo.CONTENT, vo.ID, vo.URL);
			}
			loadPhoto();
		}
		//给初始展示的子元素加载图片
		private function loadPhoto():void
		{
			for (var i:int = 0; i < showItems.length; i++ )
			{
				var item:ItemRenderer = showItems[i] as ItemRenderer;
				if (item)
				    item.load();
			}
		}
		override public function turnLeft():void 
		{
			super.turnLeft();
			loadPhoto();
		}
		override public function turnRight():void 
		{
			super.turnRight();
			loadPhoto();
		}
	}
}